package com.miyake.client.tools;

import com.google.gwt.event.dom.client.ClickEvent;
import com.google.gwt.event.dom.client.ClickHandler;
import com.google.gwt.user.client.ui.Button;
import com.google.gwt.user.client.ui.DialogBox;
import com.google.gwt.user.client.ui.HasHorizontalAlignment;
import com.google.gwt.user.client.ui.HorizontalPanel;
import com.google.gwt.user.client.ui.SimplePanel;
import com.google.gwt.user.client.ui.VerticalPanel;
import com.google.gwt.user.client.ui.Widget;

public class OkCancelDialog extends DialogBox {
	private Button btnOK;
	private Button btnCancel;
	
	public OkCancelDialog() {
		setHTML("Confirmation");
		btnOK = new Button("OK");
		btnCancel = new Button("Cancel");
		
		VerticalPanel verticalPanel = new VerticalPanel();
		verticalPanel.setHorizontalAlignment(HasHorizontalAlignment.ALIGN_CENTER);
		setWidget(verticalPanel);
		verticalPanel.setSize("100%", "100%");
		
		verticalPanel.add(getContent());
		HorizontalPanel horizontalPanel = new HorizontalPanel();
		verticalPanel.add(horizontalPanel);
				
		btnOK.addClickHandler(new ClickHandler() {
			public void onClick(ClickEvent event) {
				hide(false);
			}
		});
		horizontalPanel.add(btnOK);

		btnCancel.addClickHandler(new ClickHandler() {
			public void onClick(ClickEvent event) {
				hide(true);
			}
		});
		horizontalPanel.add(btnCancel);
	
		
	}


	public Button getBtnOK() {
		return btnOK;
	}


	public Button getBtnCancel() {
		return btnCancel;
	}


	protected Widget getContent() {
		return new SimplePanel();
	}

}
